﻿<UserControl x:Class="SoftSource.Timecard.Views.UpdateReminderView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:softsourceConverters="clr-namespace:SoftSource.Common.Converters;assembly=SoftSource.Common.Silverlight"
             xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
             xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
             xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
             xmlns:dataFormToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             d:DesignWidth="658"
             d:DesignHeight="574">

    <UserControl.Resources>
        <softsourceConverters:FormattedDateConverter x:Key="FormattedDateConverter" />
    </UserControl.Resources>

    <controlsToolkit:BusyIndicator x:Name="Busy"
                                   HorizontalContentAlignment="Stretch"
                                   VerticalContentAlignment="Stretch">
        <Grid x:Name="LayoutRoot">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid Margin="8,8,0,8">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Button Margin="0"
                        Content="Send Reminders"
                        Click="Send_Click" />
            </Grid>
            <StackPanel HorizontalAlignment="Left"
                        Margin="8,4,0,4"
                        VerticalAlignment="Top"
                        Grid.Row="2"
                        Orientation="Horizontal">
                <dataFormToolkit:DataField Label="Select All">
                    <CheckBox x:Name="AllCheckbox"
                              Checked="All_CheckChanged"
                              Unchecked="All_CheckChanged"
                              HorizontalAlignment="Left" />
                </dataFormToolkit:DataField>
                <dataFormToolkit:DataField Label="Cutoff date">
                    <controls:DatePicker x:Name="CutoffDatePicker"
                                         SelectedDateChanged="CutoffDatePicker_SelectedDateChanged" />
                </dataFormToolkit:DataField>
            </StackPanel>
            <data:DataGrid x:Name="ReminderDataGrid"
                           AutoGenerateColumns="False"
                           Grid.Row="3"
                           Grid.RowSpan="2">
                <data:DataGrid.Columns>
                    <data:DataGridTemplateColumn Header="Send">
                        <data:DataGridTemplateColumn.CellEditingTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding SendReminder, Mode=TwoWay}"
                                          HorizontalAlignment="Center"
                                          VerticalAlignment="Center" />
                            </DataTemplate>
                        </data:DataGridTemplateColumn.CellEditingTemplate>
                    </data:DataGridTemplateColumn>
                    <data:DataGridTextColumn Header="Name"
                                             Binding="{Binding Name}"
                                             IsReadOnly="True" />
                    <data:DataGridTextColumn Header="Last Entry"
                                             Binding="{Binding LastEntryDate, Converter={StaticResource FormattedDateConverter}}"
                                             IsReadOnly="True" />
                </data:DataGrid.Columns>
            </data:DataGrid>
            <StackPanel Grid.Row="1">
                <TextBlock Text="Message:"
                           TextWrapping="Wrap" />
                <TextBox x:Name="messageTextBox"
                         d:LayoutOverrides="Width"
                         MinHeight="100"
                         AcceptsReturn="True" />
            </StackPanel>
        </Grid>
    </controlsToolkit:BusyIndicator>
</UserControl>